$(function() {
	$("#left").load("../common/gover-left.html");
	var type = isEmpty(parseQueryString().type) ? 'dept' : parseQueryString().type;
	$(".ystep1").loadStep({
		size: "small",
		color: "green",
		steps: [{
				title: "事项选择"
			},
			{
				title: "服务选择"
			},
			{
				title: "信息录入"
			},
			{
				title: "寄件选择"
			},
			{
				title: "取件选择"
			},
			{
				title: "提交成功"
			}
		]
	});
	$(".ystep1").setStep(1);
	$(".yl-tabBar.yl-tabBar2>.item").click(function() {
		var index_tab = $(this).index();
		$(this).addClass("current").siblings().removeClass("current");
		$(".yl-tab .choose-block-box").eq(index_tab).removeClass("dis_no").siblings(".yl-tab .choose-block-box").addClass("dis_no")
	})

	my_vue = new Vue({
		el: '#vue_info',
		data: {
			type: "",
			grList: [],
			qyList: [],
			deptList: []
		},
		methods: {
			link: function(businessId, type) {
				window.location = "selfHelpBusinessChooseList.html?businessId=" + businessId + "&type=" + type;
			},
			changeTab: function() {
			},
			getBusList: function() {
				doMask();
				this.$http.get(gover.getBusList, {

				}).then(function(result) {
						if(result.data.success) {
							unMask();
							this.grList = result.data.data.grList;
							this.qyList = result.data.data.qyList;
							this.deptList = result.data.data.deptList;							
						}else{
							unMask();
							setTimeout("showRedMsg('','暂无事项!');", 1400);
						}

				}, function() {
					unMask();
					showRedMsg("","服务器正忙,请稍候重试")

				})
			},
		},
		ready: function() {
			//初始化获得总页面数和列表数据
			this.getBusList();
			if(type == 'gr') {
				$(".yl-tabBar.yl-tabBar2>.item").eq(1).addClass("current").siblings().removeClass("current");
				$(".yl-tab .choose-block-box").eq(1).removeClass("dis_no").siblings(".yl-tab .choose-block-box").addClass("dis_no")
			} else if(type == 'fr') {
				$(".yl-tabBar.yl-tabBar2>.item").eq(2).addClass("current").siblings().removeClass("current");
				$(".yl-tab .choose-block-box").eq(3).removeClass("dis_no").siblings(".yl-tab .choose-block-box").addClass("dis_no")
			} else {
				$(".yl-tabBar.yl-tabBar2>.item").eq(0).addClass("current").siblings().removeClass("current");
				$(".yl-tab .choose-block-box").eq(0).removeClass("dis_no").siblings(".yl-tab .choose-block-box").addClass("dis_no")
			}
			$("#"+type).click();
			var url="../up/selfHelpBusinessChoose.html";
			windowOpen(url);
		}
	});
});